package com.kuang.springcloud.service;

import com.kuang.springcloud.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;
//FeignClient 已经默认集成了 Ribbon
@FeignClient(value = "springcloud-provider",fallbackFactory= UserServiceFallbackFactory.class)

public interface UserClientService {

    @PostMapping("/user/addOne")
    Boolean addOne(User user);
    @GetMapping("/user/getOne/{uId}")
    User selectOne(@PathVariable("uId") Integer uId);
    @GetMapping("/user/getAll")
    List<User> selectAll();

}
